<?php

class Application_Form_KonsumenForm extends Zend_Form
{
    
    private function getKonsumen()
    {
        $konsumen = new Application_Model_Konsumen();
        $result = $konsumen->getAllData();
        $kon = array();
        $kon[0] = '';
        foreach($result as $konsumen)
        {
            $kon[$konsumen['id_konsumen']] = $konsumen['nama_perusahaan'];
        }
        return $kon;
    }


    public function init()
    {
        $konsumen = new Zend_Form_Element_Select('id_konsumen');
        $konsumen->setLabel('Customer Name')->setMultiOptions($this->getKonsumen());
        
        $submit = new Zend_Form_Element_Submit('submitKonsumen');
        $submit->setLabel('Choose');
        
        $this->addElements(array($konsumen, $submit));
    }


}

